

//================================================================================================================================
// code values for Media Cente status changes - these are the codes used in the tag table
//================================================================================================================================
#define DP_FS_DVD 1
#define DP_FS_EXTENSIBILITY 2
#define DP_FS_GUIDE 3
#define DP_FS_HOME 4
#define DP_FS_MUSIC 5
#define DP_FS_PHOTOS 6
#define DP_FS_RADIO 7
#define DP_FS_RECORDEDSHOWS 8
#define DP_FS_TV 9
#define DP_FS_UNKNOWN 10
#define DP_FS_VIDEOS 11

//================================================================================================================================
// Entry numbers in the tag table for each of the possible Media Centre tags
//================================================================================================================================
#define TAG_Status 0
#define TAG_Application 1
#define TAG_ArtistName 2
#define TAG_CallingPartyName 3
#define TAG_CallingPartyNumber 4 
#define TAG_CD 5
#define TAG_CurrentPicture 6
#define TAG_DialogVisible 7
#define TAG_DiscWriter_ProgressTimeChanged 8
#define TAG_DiscWriter_ProgressPercentageChanged 9
#define TAG_DiscWriter_SelectedFormat 10
#define TAG_DiscWriter_Start 11
#define TAG_DiscWriter_Stop 12
#define TAG_DVD 13
#define TAG_Ejecting 14
#define TAG_EndSession 15
#define TAG_Error 16
#define TAG_FF1 17
#define TAG_FF2 18
#define TAG_FF3 19
#define TAG_FS_DVD 20
#define TAG_FS_Extensibility 21
#define TAG_FS_Guide 22
#define TAG_FS_Home 23
#define TAG_FS_Music  24
#define TAG_FS_Photos 25
#define TAG_FS_Radio 26
#define TAG_FS_RecordedShows 27
#define TAG_FS_TV 28
#define TAG_FS_Unknown 29
#define TAG_FS_Videos 30
#define TAG_GuideLoaded 31
#define TAG_KeyPress 32
#define TAG_MediaName 33
#define TAG_MediaTime 34
#define TAG_MediaTypes 35
#define TAG_MSASPrivateTags 36
#define TAG_Mute 37
#define TAG_Next 38
#define TAG_NextFrame 39
#define TAG_ParentalAdvisoryRating 40
#define TAG_Pause 41
#define TAG_PhoneCall 42
#define TAG_Photos 43
#define TAG_Play 44
#define TAG_Prev 45
#define TAG_PrevFrame 46
#define TAG_PVR 47
#define TAG_Radio 48
#define TAG_RadioFrequency 49
#define TAG_Recording 50
#define TAG_RequestForTuner 51
#define TAG_RepeatSet 52
#define TAG_Rewind1 53
#define TAG_Rewind2 54
#define TAG_Rewind3 55
#define TAG_Shuffle 56
#define TAG_SlowMotion1 57
#define TAG_SlowMotion2 58
#define TAG_SlowMotion3 59
#define TAG_StartSession 60
#define TAG_Stop 61
#define TAG_StreamingContentAudio 62
#define TAG_StreamingContentVideo 63
#define TAG_TitleNumber 64
#define TAG_TotalTracks 65
#define TAG_TrackDuration 66
#define TAG_TrackName 67
#define TAG_TrackNumber 68
#define TAG_TrackTime 69
#define TAG_TransitionTime 70
#define TAG_TVTuner 71
#define TAG_Unknown 72
#define TAG_Visualization 73
#define TAG_Volume 74
#define TAG_TrackTimeLeft 75
#define TAG_ChannelName 76
#define TAG_SessionType 77
#define TAG_NextSessionType 78
#define TAG_RecordingStatus 79
#define TAG_RecordingSession 80
#define TAG_RecordingMediaName 81
#define TAG_RecordingTrackNumber 82
#define TAG_RecordingChannelName 83
#define TAG_PreviousStatusFlag 84
#define TAG_UseBars 85
#define TAG_IPAddress 86
#define TAG_IPPort 87
#define TAG_IPRemote 88
#define TAG_SessionFlag 89
#define TAG_SessionStatus 90
#define TAG_SessionValue 91
#define TAG_RecordingStatus1	92
#define TAG_RecordingSession1 93
#define TAG_RecordingMediaName1 94
#define TAG_RecordingTrackNumber1 95
#define TAG_RecordingChannelName1 96
#define TAG_RecordingStatus2 97
#define TAG_RecordingSession2 98
#define TAG_RecordingMediaName2 99
#define TAG_RecordingTrackNumber2 100
#define TAG_RecordingChannelName2 101
#define TAG_RecordingStatus3 102
#define TAG_RecordingSession3 103
#define TAG_RecordingMediaName3 104
#define TAG_RecordingTrackNumber3 105
#define TAG_RecordingChannelName3 106
#define TAG_RecordingStatus4 107
#define TAG_RecordingSession4 108
#define TAG_RecordingMediaName4 109
#define TAG_RecordingTrackNumber4 110
#define TAG_RecordingChannelName4 111
#define TAG_RecordingStatus5 112
#define TAG_RecordingSession5 113
#define TAG_RecordingMediaName5 114
#define TAG_RecordingTrackNumber5 115
#define TAG_RecordingChannelName5 116
#define TAG_RecordingStatus6 117
#define TAG_RecordingSession6 118
#define TAG_RecordingMediaName6 119
#define TAG_RecordingTrackNumber6 120
#define TAG_RecordingChannelName6 121
#define TAG_RecordingStatus7 122
#define TAG_RecordingSession7 123
#define TAG_RecordingMediaName7 124
#define TAG_RecordingTrackNumber7 125
#define TAG_RecordingChannelName7 126
#define TAG_RecordingStatus8 127
#define TAG_RecordingSession8 128
#define TAG_RecordingMediaName8 129
#define TAG_RecordingTrackNumber8 130
#define TAG_RecordingChannelName8 131
#define TAG_RecordingStatus9 132
#define TAG_RecordingSession9 133
#define TAG_RecordingMediaName9 134
#define TAG_RecordingTrackNumber9 135
#define TAG_RecordingChannelName9 136
#define TAG_RecordingDepth 137
#define TAG_Debug 138
#define TAG_Initialising 139
#define TAG_IgnoreSpuriousRecording 140
#define TAG_NewLogFile 141
#define TAG_StatusCount 142
#define TAG_StatusCounter 143
#define TAG_VolumeCharacter 144
#define TAG_DisplayMode   145
#define TAG_ModeChar      146
#define TAG_ModeVisible   147
#define TAG_Mode          148
#define TAG_True          149
#define TAG_False         150
#define TAG_MediaCenter   151
#define TAG_Record        152
#define TAG_Windows7HTPC  153
#define TAG_BurningDisc   154
#define TAG_Menu          155
// dont move the ones below
#define TAG_CCVolume      156
#define TAG_CCMuteOff     157
#define TAG_CCPhonecall   158
#define TAG_CCMute        159
#define TAG_CCSlowMotion3 160
#define TAG_CCSlowMotion2 161
#define TAG_CCSlowMotion1 162
#define TAG_CCPrevFrame   163
#define TAG_CCNextFrame   164
#define TAG_CCRewind3     165
#define TAG_CCRewind2     166
#define TAG_CCRewind1     167
#define TAG_CCFF3         168
#define TAG_CCFF2         169
#define TAG_CCFF1         170
#define TAG_CCRecording   171
#define TAG_CCPrev        172
#define TAG_CCNext        173
#define TAG_CCPause       174
#define TAG_CCStop        175
#define TAG_CCPlay        176
#define TAG_CustomChar1   176  // Set same as CCPlay
//Dont move the ones above
#define TAG_InitCalled    177
#define TAG_Icon          178
#define TAG_NavStatus     179
#define TAG_ChannelNotFound 180
#define TAG_RadioChannel  181
#define TAG_RadioChannelTag 182
#define TAG_UseVolIcon    183
#define TAG_DateFormat    184
#define TAG_ProcessInactive 185
//
// Number of entries in the tag table
//
#define NUM_MTAGS 186
#define MAX_CSTATE 100           // Maximum size of cstate string in tag table 
#define RECORDING_TAGS_SIZE 5   // So we can use the recording tags like an array
#define MAX_RECORDING_DEPTH 9   // Maximum depth for recording sessions
#define MUNK 0              // Unknown
#define MBOO 1              // Boolean
#define MSTR 2              // String
#define MINT 3              // Integer
#define MTIM 4              // Time
#define MDIS 5              // Disc Formats

#define INIT_FREQUENCY 3    // How often to check for a connection
//
// Tag routine definitions
//
extern char * __stdcall getst(int ptr);
extern int    __stdcall geti(int ptr);
extern char * __stdcall getb(int ptr);
extern int    __stdcall getbi(int ptr);
extern char * __stdcall gett(int ptr);
extern int    __stdcall getlength(int ptr);
extern char * __stdcall gettag(int ptr);
extern int    __stdcall gettype(int ptr);
extern char * __stdcall getdisplay(int ptr);
extern void   __stdcall gettimes(char * buf, int tag1, int tag2);
extern double __stdcall getdb(int ptr);

extern void   __stdcall putb(int ptr, char *val);
extern void   __stdcall putbi(int ptr, int val);
extern void   __stdcall start_counter(int tag);
extern void   __stdcall putst(int ptr, char *val);
extern void   __stdcall puti(int ptr, int val);
extern void   __stdcall putt(int ptr, char *val);
extern void   __stdcall puttime(int ptr, int val);
extern int    __stdcall puttag(char *line, char *wass, int *wasi);
extern void   __stdcall putdisplay(char *line);
extern void   __stdcall strcpytonl(char *so, char *si);
extern void   __stdcall putdb(int ptr, double val);

extern int    __stdcall MCE_read_ini_file(void);
extern int    __stdcall MCE_check_for_reinit();
extern void   __stdcall MCE_update_recording_status(int tag,int wasi,char *wass,char *line);
extern char * __stdcall MCE_dll_get_tvchannel(char *ichan);
extern char * __stdcall MCE_dll_get_radiochannel(char *ichan);
extern int    __stdcall MCE_dll_check_process(char *procname);
extern void   __stdcall MCE_read_cfg_file(void);
extern void   __stdcall MCE_check_counter();

extern int    __stdcall Topen_log();
extern int    __stdcall Tclose_log();
extern int    __stdcall Tlog(char * module, char * msg);
extern void   __stdcall clear_tags(void);

extern char * __stdcall get_mode_status(int mode);
extern void   __stdcall init_modes();
extern void   __stdcall set_mode(int tagval,int play, int stop, int pause, int ff1, int ff2, int ff3, 
                                   int rw1, int rw2, int rw3, int sm1, int sm2, int sm3);


